//package com.lagou.dao;
///*
// * PackageName: com.lagou.dao
// * ClassName:   IUserDaoImpl
// * Author:   zhang
// * Date:     Created in 2020/9/30
// * Description:
// * History:
// * <author>        <time>             <version>          <desc>
// * 作者姓名         修改时间            版本号              描述
// * zhang           2020/9/30      1.0
// */
//
//import com.lagou.io.Resources;
//import com.lagou.pojo.User;
//import com.lagou.sqlSession.SqlSession;
//import com.lagou.sqlSession.SqlSessionFactory;
//import com.lagou.sqlSession.sqlSessionFactoryBuilder;
//
//import java.io.InputStream;
//import java.util.List;
//
///**
// * Title:
// * Project: IPersistence_test
// *
// * @author ZhangKe
// * Created on 2020/9/30
// */
//public class IUserDaoImpl implements IUserDao{
//
//    @Override
//    public List<User> findAll() throws Exception {
//        //加载配置文件
//        InputStream resourceAsStream = Resources.getResourceAsStream("SqlMapConfig.xml");
//        //创建SqlSessionFactory
//        SqlSessionFactory sqlSessionFactory = new sqlSessionFactoryBuilder().build(resourceAsStream);
//        //生产SqlSession
//        SqlSession sqlSession = sqlSessionFactory.openSession();
//
//        List<User> users = sqlSession.selectList("user.selectList");
//        for (User user1 : users) {
//            System.out.println(user1);
//        }
//
//        return users;
//    }
//
//    @Override
//    public User findByCondition(User user) throws Exception {
//
//        InputStream resourceAsStream = Resources.getResourceAsStream("SqlMapConfig.xml");
//        SqlSessionFactory sqlSessionFactory = new sqlSessionFactoryBuilder().build(resourceAsStream);
//        SqlSession sqlSession = sqlSessionFactory.openSession();
//
//        User userResult = sqlSession.selectOne("user.selectOne", user);
//        System.out.println(userResult);
//
//        return userResult;
//    }
//}
